package com.dao;

import com.entity.Admin;
import com.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("userDAO") // Repository标签定义数据库连接的访问 Spring中直接扫描加载
@Mapper
public interface UserDAO {
    public List<User> getUserByCond(User user);
    public int insertUser(User user);
    public List<User> getAllUser();
    public int updateUser(User User);

    // 按主键删除管理员表数据 调用mapper包admin.xml里的deleteAdmin配置 返回值0(失败),1(成功)
    public int deleteUser(String id);

    // 批量删除管理员表数据 调用mapper包admin.xml里的deleteAdminByIds配置 返回值0(失败),大于0(成功)
    public int deleteUserByIds(String[] ids);
    public User getUserById(String id);

    public List<User> getUserByUsername(String username);

}
